﻿<UserControl x:Class="Showroom.WPF.Views.Virtualization"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Showroom.ViewModels" xmlns:fl="clr-namespace:SStuff.FlowControls;assembly=SStuff.FlowControls" mc:Ignorable="d" 
             d:DesignHeight="768" d:DesignWidth="1024">
    <UserControl.DataContext>
        <vm:VirtualizationSampleData />
    </UserControl.DataContext>
    <UserControl.Resources>
        <DataTemplate x:Key="itemTemplate">
            <Border Width="200" Height="150">
                <TextBlock Text="{Binding}" HorizontalAlignment="Center" VerticalAlignment="Center" />
            </Border>
        </DataTemplate>
    </UserControl.Resources>
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height=".5*" />
            <RowDefinition Height=".5*" />
        </Grid.RowDefinitions>
        <TextBlock TextWrapping="Wrap" Text="The following FlowItemsControl2D and FlowItemsControl3D are bound to a collection of 20000 items and perform well thanks to their virtualization logic." />
        <fl:FlowItemsControl2D ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" />
        <fl:FlowItemsControl3D Grid.Row="1" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" />
    </Grid>
</UserControl>
